
package datos;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import conexion.ConexionBD;

public class ConsultaCliente {

	ResultSet res;
	PreparedStatement pstm;
	ConexionBD conect = new ConexionBD();
	
	
	public ResultSet getCliente(String id) throws SQLException{
		pstm = conect.getConexion().prepareStatement(
			    "SELECT" +
			    " idcliente," +
			    " nombre," +
			    " telefono, "+
			    " direccion "+
			    " FROM cliente" +
			    " WHERE idcliente = '"+id+"';");
		res = pstm.executeQuery();
		
		return res;
	}
	
	public ResultSet getClientes() throws SQLException{
		pstm = conect.getConexion().prepareStatement(
				"SELECT" +
				" idcliente," +
				" nombre," +
				" telefono," +
				" direccion," +
				" FROM cliente ;");
		res = pstm.executeQuery();
		return res;
	}
	
}

